package com.tianye.salon.service.impl;

import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tianye.salon.dao.MapCityMapper;
import com.tianye.salon.model.MapCity;
import com.tianye.salon.service.MapCityService;
import com.tianye.salon.util.CheckUtil;


@Service("mapCityService")
public class MapCityServiceImpl
		extends BaseServiceImpl<MapCity,MapCityMapper>
		implements MapCityService {
			
	@Autowired
	private MapCityMapper mapCityMapper;
	
	@Override
	public MapCityMapper getMapper() throws Exception {
		return mapCityMapper;
	}
	
	/**
	 * 添加或修改
	* @Title: saveOrUpdate 
	* @Param model 实体
	* @return    设定文件 
	* @throws 
	* @author wangzhanguo
	* @date 2017-09-26 15:08:18
	 */
	public Map<String,Object> saveOrUpdate(MapCity model){
		Integer id = model.getId();
		Integer i = 0;
		if(!CheckUtil.isEmpty()&&id > 0){
			i = mapCityMapper.updateByPrimaryKeySelective(model);
		}else{
			i = mapCityMapper.insertSelective(model);
		}
		if(i > 0){
			return getSussRtn(i);
		}
		return getFailRtn("保存或修改失败");
	}
}
